<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/5/24
 * Time: 16:22
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\common\business;


use app\common\model\mysql\User as ModelObj;
use think\Exception;
use think\facade\Cache;

class User extends BusBase
{
    protected $modelObj = null;

    public function __construct()
    {
        $this->modelObj = new ModelObj();
    }

    public function check(array $data = [])
    {
        if (empty($data)) {
            throw new Exception("数据不能为空");
        }
        //根据手机号查询验证码
        $getCode = Cache::get(config('sms.code_pre_') . $data['phone_number']);
        if (!$getCode || $getCode != $data['code']) {
            throw new \Exception("不存在该验证码");
        }
        
    }
}